
#include "uproute.h"

#define ROUNDUP(a, size) ((a) & ((size) - 1) ? (1 + ((a) | ((size) - 1))) : (a))


#define NEXT_SA(ap) ap = (struct sockaddr*)\
    ((caddr_t)ap + (sizeof(struct sockaddr) ? ROUNDUP(sizeof(struct sockaddr), sizeof(u_long)) : \
                                    sizeof(u_long)))

void get_rtaddrs(int addrs, struct sockaddr * sa, struct sockaddr ** rti_info) {

    int i = 0;
    for (i = 0; i < RTAX_MAX; i++) {

        if (addrs & (1 << i)) {

            rti_info[i] = sa;
            NEXT_SA(sa);
        } else {


        }
    }
}
